<?php
/**
 * Created by PhpStorm.
 * User: zhangrxiang
 * Date: 2016/12/15
 * Time: 15:30
 */

class Ref{
	private $refName = __CLASS__;

	/**
	 * Ref constructor.
	 * __construct
	 */
	function __construct($name = "constructor") {
	}
	public function printOut(){
		echo __FUNCTION__.PHP_EOL;
	}
	public function printClassName(){
		echo PHP_EOL.$this->refName.PHP_EOL;
	}
}
$new = new ReflectionClass("Ref");

$getConstructor = $new->getConstructor();
echo $getConstructor->getName().PHP_EOL;
echo $getConstructor->getDocComment().PHP_EOL;
print_r( $getConstructor->getParameters());
echo $getConstructor->getNumberOfParameters().PHP_EOL;
echo gettype($getConstructor->isPrivate()).PHP_EOL;
var_dump($getConstructor);


echo $new->getDocComment();
$getMethod = $new->getMethod("printClassName");
$getMethod->invoke($new->newInstance());



$newIns = $new->newInstance();
$newIns->printClassName();


$file = fopen(__FILE__,"r");
//var_dump(fread($file,filesize(__FILE__)));
var_dump(readline(__FILE__));
